Public Class SProc_Factory
    Public Enum SORT As Integer
        DATE_ASC = 1
        DATE_DESC = 2
        VER_ASC = 3
        VER_DESC = 4
        NAME_ASC = 5
        NAME_DESC = 6
    End Enum

    Public Function GetAllSProcsForDatabase( _
                        ByVal lDatabaseID As Long, _
                        Optional ByVal lSort As SORT = SORT.NAME_ASC) As Collection

        Dim oFactory As New DBSProc_Factory
        Return oFactory.GetAllSProcsForDatabase(lDatabaseID, lSort)
    End Function

    Public Function GetAllSProcsForDatabase( _
                        ByVal lDatabaseID As Long, _
                        ByVal lDatabaseRevID As Long, _
                        Optional ByVal lSort As SORT = SORT.NAME_ASC) As Collection

        Dim oFactory As New DBSProc_Factory
        Return oFactory.GetAllSProcsForDatabase(lDatabaseID, lSort)
    End Function

    Public Function GetAllSProcsForDatabase( _
                    ByVal lDatabaseID As Long, _
                    ByVal sStartDate As String, _
                    ByVal sEndDate As String, _
                    ByVal lSort As SProc_Factory.SORT) As Collection

        Dim oFactory As New DBSProc_Factory
        Return oFactory.GetAllSProcsForDatabase(lDatabaseID, sStartDate, sEndDate, lSort)
    End Function

    Public Function GetSProcByName( _
                        ByVal lDatabaseID As Long, _
                        ByVal lOwnerID As Long, _
                        ByVal sSProc As String) As SQLAutoDocLib.SProc

        Dim oFactory As New DBSProc_Factory
        Return oFactory.GetSProcsByName(lDatabaseID, lOwnerID, sSProc)
    End Function

    Public Function GetAllSProcRevs( _
        ByVal lSprocID As Long) As ArrayList

        Dim oFactory As New DBSProc_Factory
        Return oFactory.GetAllSProcRevs(lSprocID)
    End Function

    Public Function FindSProcs( _
        ByVal lServerID As Long, _
        ByVal lDatabaseID As Long, _
        ByVal sStartDate As String, _
        ByVal sEndDate As String, _
        ByVal sSearchText As String) As ArrayList

        Dim oFactory As New DBSProc_Factory
        Return oFactory.FindSProcs(lServerID, lDatabaseID, sStartDate, sEndDate, sSearchText)
    End Function

    Public Function CountOfActiveProcsForDatabase(ByVal lDatabaseID As Long)
        Dim oFactory As New DBSProc_Factory
        Return oFactory.CountOfActiveProcsForDatabase(lDatabaseID)
    End Function
End Class
